
'use strict'
// Template version: 1.1.3
// see http://vuejs-templates.github.io/webpack for documentation.

const path = require('path')

module.exports = {
  build: {
    env: require('./prod.env'),
    index: path.resolve(__dirname, '../dist/index.html'),
    assetsRoot: path.resolve(__dirname, '../dist'),
    assetsSubDirectory: 'static',
    assetsPublicPath: './',
    productionSourceMap: true,
    // Gzip off by default as many popular static hosts such as
    // Surge or Netlify already gzip all static assets for you.
    // Before setting to `true`, make sure to:
    // npm install --save-dev compression-webpack-plugin
    productionGzip: false,
    productionGzipExtensions: ['js', 'css'],
    //使用额外的参数运行构建命令
	//查看包分析器在构建完成后的报告:
	//npm运行构建—报告
	//设置为真或假，总是把它打开或关闭
    bundleAnalyzerReport: process.env.npm_config_report
  },
  dev: {
    env: require('./dev.env'),
    port: process.env.PORT || 8088,
    autoOpenBrowser: true,
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    //代理表   设置代理的后台服务器的ip地址
    proxyTable: {		//代理表   设置代理的后台服务器的ip地址(代理有没有不受影响)
    	'/ceshi':{		//代理的路径
    		target:"http://192.168.1.138:8088",		//代理的目标		后台服务器
    		changOrigin:true,		//改变源
    		//secure:false,		//安全性  可以忽略
    		pathRewrite:{'^/ceshi':'/ceshi'}		//路径重写
    	}
    	
    },
    //CSS在默认情况下会出现错误，因为相对路径是“错误的”
		//有了这个选项，根据css-loader README
		//(https://github.com/webpack/css-loader # sourcemaps)
    cssSourceMap: false
  }
}
